{mtemplate '_header'}
<div class="dm-subnav">
	<div class="subnav-title">订单管理</div>
    <ul>
        <li class="{if $operation == 'list' && $method == 'getself'}active{/if}"><a href="{php echo manage_url(array('r'=>'order','ac'=>'index','op'=>'list','status'=>'0','method'=>'getself'))}">堂食/自取</a></li>
        <li class="{if $operation == 'list' && $method == 'takeout'}active{/if}"><a href="{php echo manage_url(array('r'=>'order','ac'=>'index','op'=>'list','status'=>'0','method'=>'takeout'))}">外卖</a></li>
    </ul>
	<!-- <ul>
		
	</ul> -->
</div>
<div class="dm-container">
<div class="dm-content">
{if $operation == 'list'}
<style type="text/css">
.trorder {
    background: #f7f7f7;
    border: 1px solid #e7eaec;
    text-align: left;
    border-bottom: 0;
}
.trorder td{padding: 14px 0 !important;}
.table>thead>tr>th, .table>tbody>tr>th, .table>tfoot>tr>th, .table>thead>tr>td, .table>tbody>tr>td, .table>tfoot>tr>td {
     vertical-align: middle; 
}
.table > thead > tr > th, .table > tbody > tr > th, .table > tfoot > tr > th, .table > thead > tr > td, .table > tbody > tr > td, .table > tfoot > tr > td {
    border-top: 0px solid #e7eaec;
    line-height: 1.42857;
    padding: 8px;
    vertical-align: middle;
}
.trbody td {
    text-align: center;
    vertical-align: top;
    border-left: 1px solid #e7eaec;
    overflow: hidden;
    font-size: 12px;
    background: #ffffff;
}
.ops {
    border-right: 1px solid #e7eaec;
    text-align: center;
}
.table td a{cursor: pointer;}
.page-toolbar {
    position: relative;
    width: 100%;
    padding: 0;
    height: 35px;
    line-height: 1;
    vertical-align: middle;
    margin-bottom: 15px;
}
.input-group-select {
    float: right;
}
.table>thead>tr>th {
    border-bottom: 0px;
    font-weight: normal;
}
</style>
<form action="./index.php" method="get" class="form-horizontal" role="form">
    <input type="hidden" name="c" value="site">
    <input type="hidden" name="i" value="{$_W['uniacid']}">
    <input type="hidden" name="a" value="entry">
    <input type="hidden" name="op" value="list">
    <input type="hidden" name="r" value="order">
    <input type="hidden" name="ac" value="index">
    <input type="hidden" name="do" value="manage">
    <input type="hidden" name="m" value="deam_food">
    <input type="hidden" name="status" value="{$status}">
<div class="page-toolbar">
    <div class="input-group">
    <input type="text" style="width: 200px;float: right;" class="form-control" name="keyword" value="{$keyword}" placeholder="请输入关键词">
    <span class="input-group-select">
        <select name="searchfield" class="form-control" style="width:110px;padding:0 5px;">
            <option value="ordernumber" {if $searchfield == 'ordernumber'} selected="" {/if}>取餐号</option>
            <option value="ordersn" {if $searchfield == 'ordersn'} selected="" {/if}>订单号</option>
        </select>
    </span>
    <span class="input-group-btn">
        <button type="submit" class="btn btn-primary">搜索</button>
    </span>
    </div>
</div>        
</form>
<ul class="we7-page-tab" style="margin-left: 0;margin-right: 0;margin-top: -10px;margin-bottom: 20px;">
{if $method == 'getself'}
    <li class="{if $operation == 'list' && $status == '0'}active{/if}"><a href="{php echo manage_url(array('r'=>'order','ac'=>'index','op'=>'list','status'=>'0','method'=>'getself'))}">全部订单</a></li>
    <li class="{if $operation == 'list' && $status == '1'}active{/if}"><a href="{php echo manage_url(array('r'=>'order','ac'=>'index','op'=>'list','status'=>'1','method'=>'getself'))}">等待接单</a></li>
    <li class="{if $operation == 'list' && $status == '2'}active{/if}"><a href="{php echo manage_url(array('r'=>'order','ac'=>'index','op'=>'list','status'=>'2','method'=>'getself'))}">制作中</a></li>
    <li class="{if $operation == 'list' && $status == '3'}active{/if}"><a href="{php echo manage_url(array('r'=>'order','ac'=>'index','op'=>'list','status'=>'3','method'=>'getself'))}">已完成</a></li>
{elseif $method == 'takeout'}
    <li class="{if $operation == 'list' && $status == '0'}active{/if}"><a href="{php echo manage_url(array('r'=>'order','ac'=>'index','op'=>'list','status'=>'0','method'=>'takeout'))}">全部订单</a></li>
    <li class="{if $operation == 'list' && $status == '1'}active{/if}"><a href="{php echo manage_url(array('r'=>'order','ac'=>'index','op'=>'list','status'=>'1','method'=>'takeout'))}">等待接单</a></li>
    <li class="{if $operation == 'list' && $status == '2'}active{/if}"><a href="{php echo manage_url(array('r'=>'order','ac'=>'index','op'=>'list','status'=>'2','method'=>'takeout'))}">待配送</a></li>
    <li class="{if $operation == 'list' && $status == '4'}active{/if}"><a href="{php echo manage_url(array('r'=>'order','ac'=>'index','op'=>'list','status'=>'4','method'=>'takeout'))}">正在配送</a></li>
    <li class="{if $operation == 'list' && $status == '3'}active{/if}"><a href="{php echo manage_url(array('r'=>'order','ac'=>'index','op'=>'list','status'=>'3','method'=>'takeout'))}">已完成</a></li>
{/if}
</ul>
{if empty($list)}
<div class="panel we7-panel panel-default">
    <div class="panel-body" style="text-align: center;padding:30px;">
        暂时没有符合条件的订单
    </div>
</div>
{else}
<form action="" method="post">
    
	<table class="table table-responsive" style="width: 100%;">
		 <thead class="navbar-inner">
            <tr style="background: #f8f8f8;height: 35px;line-height: 35px;padding: 0 20px;font-size: 12px;">
                <th style="width:300px">商品</th>
                <th style="width:100px" class="text-right">单价/数量</th>
                <th class="text-center">支付金额</th>
                <th class="text-center">支付时间</th>
                <th class="text-center">状态</th>
                <th style="width: 250px;" class="text-center">操作</th>
            </tr>
        </thead>
        <tbody>
        <tr><td colspan="6" style="height:20px;padding:0;border-top:none;">&nbsp;</td></tr>
        {loop $list $orderItem}
        <tr class="trorder">
            <td colspan="3" style="padding-left: 10px !important;">订单编号:  {$orderItem['ordersn']}
            {if $orderItem['order_type']=='1'}<span style="margin-left: 15px;" class="label label-success">{$orderItem['getfood_time']}</span>{/if}
            {if !empty($orderItem['order_number'])}<span style="margin-left: 5px;" class="label label-danger">{$orderItem['order_number']}</span>{/if} {if $orderItem['order_type'] == '2'}{if $orderItem['deliver_type']=='0'}<span style="margin-left: 15px;" class="label label-warning">商家配送</span>{elseif $orderItem['deliver_type']=='1'}<span style="margin-left: 15px;" class="label label-warning showpop" data-toggle="popover" data-trigger="hover" data-placement="top" data-html="true" data-content="<p style=''>{if empty($orderItem['deliverText'])}暂未收到消息{else}{$orderItem['deliverText']}{/if}</p>">达达配送</span>
            {elseif $orderItem['deliver_type']=='-1'}<span style="margin-left: 15px;" class="label label-danger">达达配送失败，原因：{$orderItem['deliver_dada_failreason']}</span>
            {if in_array('store_class_deal',$user_permissionArr)}<a href="{php echo manage_url(array('r'=>'order','ac'=>'index','op'=>'to_dada','orderid'=>$orderItem['id'],'method'=>'takeout'))}" class="text-danger"><i class="fa fa-refresh" data-toggle="tooltip" data-placement="top" data-original-title="重新提交至达达"></i></a>{/if}
            {/if}{/if}</td>
            <td colspan="3" style="text-align:right;font-size:18px;padding-right: 15px !important;color: #5d5d5d" class="aops">
            {if $orderItem['order_type'] == '1'}
                <a style="margin-right: 10px;" class="call-bell" data-orderid="{$orderItem['id']}"><i class="fa fa-bell-o" data-toggle="tooltip" data-placement="top" data-original-title="叫号取餐"></i></a>
            {/if}
                <a href="{php echo manage_url(array('r'=>'order','ac'=>'index','op'=>'print_order','orderid'=>$orderItem['id'],'method'=>trim($_GPC['method'])))}"><i class="fa fa-print" data-toggle="tooltip" data-placement="top" data-original-title="打印订单"></i></a>
            </td>
        </tr>
        {php $goods_count = 0}
        {loop $orderItem['goods_list'] $goods_list}
        {if empty($goods_list['hasoption']) && $goods_list['count']>0}
        <tr class="trbody">
            <td style="text-align: left;overflow:hidden;width:300px">{$goods_list['name']}</td>
            <td style="text-align:right;border-left:none;width:100px">¥ {$goods_list['marketprice']}<br>x{$goods_list['count']}</td>
            {if $goods_count == 0}
            <td style="text-align:center" rowspan="{$orderItem['type_count']}">¥ {$orderItem['pay_price']} {if $orderItem['refund_fee']>0}<i class="fa fa-info-circle"  data-toggle="tooltip" data-placement="top" title="已退款{$orderItem['refund_fee']}元"></i>{/if}</td>
            <td style="text-align:center" rowspan="{$orderItem['type_count']}">{php echo date('Y-m-d',$orderItem['paytime'])}<br>{php echo date('H:i:s',$orderItem['paytime'])}</td>
            <td rowspan="{$orderItem['type_count']}">
            {if $orderItem['order_type'] == '1'}
                {if $orderItem['status']=='1'}
                <span class="label label-danger">等待接单</span>
                {elseif $orderItem['status']=='2'}
                <span class="label label-warning">制作中</span>
                {elseif $orderItem['status']=='3'}
                <span class="label label-success">已完成</span>
                {/if}
            {elseif $orderItem['order_type'] == '2'}
                {if $orderItem['status']=='0'}
                <span class="label label-default">等待付款</span>
                {elseif $orderItem['status']=='1'}
                <span class="label label-danger">等待接单</span>
                {elseif $orderItem['status']=='2'}
                <span class="label label-warning">待配送</span>
                {elseif $orderItem['status']=='4'}
                <span class="label label-warning">正在配送</span>
                {elseif $orderItem['status']=='5'}
                <span class="label label-info">订单已关闭</span>
                {elseif $orderItem['status']=='3'}
                <span class="label label-success">已完成</span>
                {/if}
            {/if}
            </td>
            <td rowspan="{$orderItem['type_count']}" class="ops">
            {if in_array('store_class_deal',$user_permissionArr)}
            {if $orderItem['order_type'] == '1'}
                {if $orderItem['status']=='1'}
                <a class="text-success" onclick="return confirm('确认接单？\r\n接单后无法取消');return false;" href="{php echo manage_url(array('r'=>'order','ac'=>'index','op'=>'deal','status'=>'2','orderid'=>$orderItem['id'],'method'=>'getself'))}">确定接单</a>
                {elseif $orderItem['status']=='2'}
                <a class="text-success" href="{php echo manage_url(array('r'=>'order','ac'=>'index','op'=>'deal','status'=>'3','orderid'=>$orderItem['id'],'method'=>'getself'))}">完成订单</a>
                {elseif $orderItem['status']=='3'}
                
                {/if}
            {elseif $orderItem['order_type'] == '2'}
                {if $orderItem['status']=='1'}
                <a class="text-success" onclick="return confirm('确认接单？\r\n接单后无法取消');return false;" href="{php echo manage_url(array('r'=>'order','ac'=>'index','op'=>'deal','status'=>'2','orderid'=>$orderItem['id'],'method'=>'takeout'))}">确定接单</a>
                {elseif $orderItem['status']=='2'}
                <a class="text-success" href="{php echo manage_url(array('r'=>'order','ac'=>'index','op'=>'deal','status'=>'4','orderid'=>$orderItem['id'],'method'=>'takeout'))}">开始配送</a>
                {if $orderItem['deliver_type']!='0'}<i class="fa fa-question-circle text-danger" data-toggle="tooltip" data-placement="top" data-original-title="第三方配送订单，请勿随意更改订单状态"></i>{/if}
                {elseif $orderItem['status']=='3'}

                {elseif $orderItem['status']=='4'}
                <a class="text-success" href="{php echo manage_url(array('r'=>'order','ac'=>'index','op'=>'deal','status'=>'3','orderid'=>$orderItem['id'],'method'=>'takeout'))}">配送成功</a>
                {if $orderItem['deliver_type']!='0'}<i class="fa fa-question-circle text-danger" data-toggle="tooltip" data-placement="top" data-original-title="第三方配送订单，请勿随意更改订单状态"></i>{/if}
                {/if}
            {/if}
            {/if}
            {if $pay_setting['wechat_refund']['switch'] == '1' && in_array('store_class_refund',$user_permissionArr)}
            <a class="text-danger" href="javascript:;" data-toggle="modal" data-target="#refund_{$orderItem['id']}" style="margin-left: 5px;" data-id="{$orderItem['id']}">退款</a>
            {/if}
            </td>
            {/if}
        </tr>
        {php $goods_count++}
        {else}
        {loop $goods_list['options'] $options}
        {if $options['count']>0}
        <tr class="trbody">
            <td style="text-align: left;overflow:hidden;width:300px">{$goods_list['name']}<br>{$options['name']}</td>
            <td style="text-align:right;border-left:none;width:100px">¥ {$options['marketprice']}<br>x{$options['count']}</td>
            {if $goods_count == 0}
            <td style="text-align:center" rowspan="{$orderItem['type_count']}">¥ {$orderItem['pay_price']}  {if $orderItem['refund_fee']>0}<i class="fa fa-info-circle"  data-toggle="tooltip" data-placement="top" title="已退款{$orderItem['refund_fee']}元"></i>{/if}</td>
            <td style="text-align:center" rowspan="{$orderItem['type_count']}">{php echo date('Y-m-d',$orderItem['paytime'])}<br>{php echo date('H:i:s',$orderItem['paytime'])}</td>
            <td rowspan="{$orderItem['type_count']}">
            {if $orderItem['order_type'] == '1'}
                {if $orderItem['status']=='1'}
                <span class="label label-danger">等待接单</span>
                {elseif $orderItem['status']=='2'}
                <span class="label label-warning">制作中</span>
                {elseif $orderItem['status']=='3'}
                <span class="label label-success">已完成</span>
                {/if}
            {elseif $orderItem['order_type'] == '2'}
                {if $orderItem['status']=='0'}
                <span class="label label-default">等待付款</span>
                {elseif $orderItem['status']=='1'}
                <span class="label label-danger">等待接单</span>
                {elseif $orderItem['status']=='2'}
                <span class="label label-warning">待配送</span>
                {elseif $orderItem['status']=='4'}
                <span class="label label-warning">正在配送</span>
                {elseif $orderItem['status']=='5'}
                <span class="label label-info">订单已关闭</span>
                {elseif $orderItem['status']=='3'}
                <span class="label label-success">已完成</span>
                {/if}
            {/if}
            </td>
            <td rowspan="{$orderItem['type_count']}" class="ops">
            {if in_array('store_class_deal',$user_permissionArr)}
            {if $orderItem['order_type'] == '1'}
                {if $orderItem['status']=='1'}
                <a class="text-success" onclick="return confirm('确认接单？\r\n接单后无法取消');return false;" href="{php echo manage_url(array('r'=>'order','ac'=>'index','op'=>'deal','status'=>'2','orderid'=>$orderItem['id'],'method'=>'getself'))}">确定接单</a>
                {elseif $orderItem['status']=='2'}
                <a class="text-success" href="{php echo manage_url(array('r'=>'order','ac'=>'index','op'=>'deal','status'=>'3','orderid'=>$orderItem['id'],'method'=>'getself'))}">完成订单</a>
                {elseif $orderItem['status']=='3'}
                
                {/if}
            {elseif $orderItem['order_type'] == '2'}
                {if $orderItem['status']=='1'}
                <a class="text-success" onclick="return confirm('确认接单？\r\n接单后无法取消');return false;" href="{php echo manage_url(array('r'=>'order','ac'=>'index','op'=>'deal','status'=>'2','orderid'=>$orderItem['id'],'method'=>'takeout'))}">确定接单</a>
                {elseif $orderItem['status']=='2'}
                <a class="text-success" href="{php echo manage_url(array('r'=>'order','ac'=>'index','op'=>'deal','status'=>'4','orderid'=>$orderItem['id'],'method'=>'takeout'))}">开始配送</a>
                {if $orderItem['deliver_type']!='0'}<i class="fa fa-question-circle text-danger" data-toggle="tooltip" data-placement="top" data-original-title="第三方配送订单，请勿随意更改订单状态"></i>{/if}
                {elseif $orderItem['status']=='3'}

                {elseif $orderItem['status']=='4'}
                <a class="text-success" href="{php echo manage_url(array('r'=>'order','ac'=>'index','op'=>'deal','status'=>'3','orderid'=>$orderItem['id'],'method'=>'takeout'))}">配送成功</a>
                {if $orderItem['deliver_type']!='0'}<i class="fa fa-question-circle text-danger" data-toggle="tooltip" data-placement="top" data-original-title="第三方配送订单，请勿随意更改订单状态"></i>{/if}
                {/if}
            {/if}
            {/if}
            {if $pay_setting['wechat_refund']['switch'] == '1' && in_array('store_class_refund',$user_permissionArr)}
            <a class="text-danger" href="javascript:;" data-toggle="modal" data-target="#refund_{$orderItem['id']}" style="margin-left: 5px;" data-id="{$orderItem['id']}">退款</a>
            {/if}
            </td>
            {/if}
        </tr>
        {php $goods_count++}
        {/if}
        {/loop}
        {/if}
        
        {/loop}
        {if $orderItem['order_type'] == '2'}
        <tr class="trorder" style="background: #fff;border-bottom: 1px solid #e7eaec">
            <td colspan="5" style="padding-left: 10px !important;">配送信息:  <span class="text-warning">{$orderItem['address_info']['realname']} {$orderItem['address_info']['telphone']} {$orderItem['address_info']['address']} {$orderItem['address_info']['address_road']} {$orderItem['address_info']['number']}</span></td>
            <td colspan="1" style="text-align:right;font-size:14px;color: red;padding-right: 10px !important;" class="aops"></td>
        </tr>
        {/if}
        <tr class="trorder" style="background: #fff;border-bottom: 1px solid #e7eaec">
            <td colspan="5" style="padding-left: 10px !important;">备注:  <span class="text-danger">{$orderItem['remark']}</span></td>
            <td colspan="1" style="text-align:right;font-size:14px;color: red;padding-right: 10px !important;" class="aops">{if !empty($orderItem['deskInfo']['name'])}桌号：{$orderItem['deskInfo']['name']}{/if}</td>
        </tr>
        <tr style="border-bottom:none;background:#f9f9f9;">
            <td colspan="6" style="text-align:left;height:0;padding:0"></td>
        </tr>
        <tr><td colspan="6" style="height:20px;padding:0;border-top:none;">&nbsp;</td></tr>

        <div class="modal fade" id="refund_{$orderItem['id']}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
          <div class="modal-dialog" role="document">
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">退款订单号：{$orderItem['ordersn']}</h4>
              </div>
              <div class="modal-body">
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">订单实际支付</label>
                    <div class="col-sm-3 col-xs-12">
                        <p class="form-control-static">{$orderItem['pay_price']}元</p>
                    </div>
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label text-right">已退金额</label>
                    <div class="col-sm-3 col-xs-12 text-right">
                        <p class="form-control-static">{$orderItem['refund_fee']}元</p>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">本次退款</label>
                    <div class="col-sm-9 col-xs-12">
                        <div class="input-group">
                            <input type="text" name="refund_fee_{$orderItem['id']}" class="form-control" value="" />
                            <span class="input-group-addon">元</span>
                        </div>
                        <div class="help-block">本次退款不能大于{php echo $orderItem['pay_price']-$orderItem['refund_fee']}</div>
                    </div>
                    
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">退款原因</label>
                    <div class="col-sm-9 col-xs-12">
                        <input type="text" name="refund_reason_{$orderItem['id']}" class="form-control" value="" />
                        <div class="help-block"></div>
                    </div>
                    
                </div>
              </div>
              <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary refund-btn" data-id="{$orderItem['id']}">退款</button>
              </div>
            </div>
          </div>
        </div>


        {/loop}
        </tbody>
	</table>
	{$pager}
</form>
<script type="text/javascript">
    require(['bootstrap'], function ($) {
        $('.showtitle').hover(function () {
            $(this).tooltip('show');
        }, function () {
            $(this).tooltip('hide');
        });
        $('.showpop').on('shown.bs.popover', function () {
            $('.showpop').not(this).popover('hide');
        });
        $('[data-toggle="popover"]').popover("destroy").popover({
            container: $(document.body)
        });
    });
    $(".refund-btn").on("click",function(){
        var orderId = $(this).data("id");
        var refundFee = $("input[name='refund_fee_"+orderId+"']").val();
        var refundReason = $("input[name='refund_reason_"+orderId+"']").val();
        if(refundFee == ''){
            util.message("退款金额不能为空！");
            return false;
        }
        $.ajax({
            url:"{php echo manage_url(array('r'=>'order','ac'=>'index','op'=>'refund'))}",
            type:'POST', //GET
            async:true,    //或false,是否异步
            data:{
                orderid:orderId,
                refund_fee:refundFee,
                refund_reason:refundReason,
            },
            timeout:5000,    //超时时间
            dataType:'json',    //返回的数据格式：json/xml/html/script/jsonp/text
            beforeSend:function(xhr){
            },
            success:function(data,textStatus,jqXHR){
                console.log(data)
                console.log(textStatus)
                console.log(jqXHR)
                if(data.status == 0){
                    util.message(data.result.message);
                }else{
                    util.message(data.result.message,"{php echo manage_url(array('r'=>'order','ac'=>'index','op'=>'list','status'=>$_GPC['status'],'method'=>$_GPC['method']))}","success");
                }
            },
            error:function(xhr,textStatus){
                console.log('错误')
                console.log(xhr)
                console.log(textStatus)
            },
        })
    });
    $('.refund-modal').on("click",function(){
        // var orderId = $(this).data("id");
        // $.ajax({
        //     url:"{php echo manage_url(array('r'=>'order','ac'=>'index','op'=>'refund'))}",
        //     type:'POST', //GET
        //     async:true,    //或false,是否异步
        //     data:{
        //         orderid:orderId
        //     },
        //     timeout:5000,    //超时时间
        //     dataType:'json',    //返回的数据格式：json/xml/html/script/jsonp/text
        //     beforeSend:function(xhr){
        //     },
        //     success:function(data,textStatus,jqXHR){
        //         console.log(data)
        //         console.log(textStatus)
        //         console.log(jqXHR)
        //     },
        //     error:function(xhr,textStatus){
        //         console.log('错误')
        //         console.log(xhr)
        //         console.log(textStatus)
        //     },
        // })
        $('#refund').modal()
    });
    $(".call-bell").on("click",function(){
        var orderId = $(this).data("orderid");
        $.ajax({
            url:"{php echo manage_url(array('r'=>'order','ac'=>'bell','op'=>'get_food'))}",
            type:'POST', //GET
            //async:true,    //或false,是否异步
            data:{
                orderid:orderId
            },
            timeout:5000,    //超时时间
            dataType:'json',    //返回的数据格式：json/xml/html/script/jsonp/text
            beforeSend:function(xhr){
            },
            success:function(data,textStatus,jqXHR){
                if(data.status == 0){
                    util.message(data.result.err_msg);
                }else{
                    var promptSound = new Audio(data.result.message);
                    promptSound.play();
                }
                console.log(data)
                console.log(textStatus)
                console.log(jqXHR)
            },
            error:function(xhr,textStatus){
                console.log('错误')
                console.log(xhr)
                console.log(textStatus)
            },
        })
    });
</script>

{/if}
{/if}
</div>
</div>

{mtemplate '_footer'}